<!DOCTYPE html>
<html lang="en">
<head>

	<meta charset="utf-8"/>
	<title>Page Title</title>

</head>
<body>

	<a id="toggler" href="#target">Click to toggle</a>

	<div id="target"></div>

	<script>
		var toggler = document.getElementById('toggler');
		var target = document.getElementById('target');
		toggler.addEventListener('click', function() {
			target.innerHTML = '<img src="bad"/>';
		});
	</script>

</body>
</html>
